<template>
  <el-dialog
    title="督办"
    :visible.sync="dialogVisible"
    custom-class="custom-dialog"
    width="43%"
    :before-close="handleClose"
  >
    <el-table
      border
      size="small"
      :data="newArr"
      height="300px"
      style="width: 100%"
    >
      <el-table-column
        prop="creatUserName"
        label="督办人"
        show-overflow-tooltip
        width="120"
      />
      <el-table-column
        prop="creatTime"
        label="督办时间"
        show-overflow-tooltip
        width="150"
        ref="time"
      />
      </el-table-column>

      <el-table-column
        prop="content"
        label="督办意见"
        show-overflow-tooltip
        width="450"
      />
    </el-table>

  </el-dialog>
</template>
<script>
import { parseTime } from "@/utils/index";
import { applySuperviseList } from "@/api/wfm/wfm.js";
export default {
  data() {
    return {
      newArr: []
    };
  },
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    toSonData: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    handleClose() {
      this.$emit("closeDialog");
      //   this.clearData();
    },
  },
  created() {
    this.$bus.on("getsuperviseList", data => {
      //传值之后的事件处理
      applySuperviseList({caseCode:data})
        .then(result => {
          let { rows, code } = result;
          rows.forEach(item=>{
            item.creatTime=parseTime(item.creatTime, "{y}.{m}.{d}")
          })
          this.newArr = rows;
        })
        .catch(() => {});
    });
  },
  
 destroyed(){
   this.newArr=[]
 }
};
</script>